<?php echo '';exit;?>
<!--{eval $_G[cookie][extstyle] = false;}-->
<!--{subtemplate common/header_common}-->
<!--{eval}-->
$diymode = 1;
function get_member_count($uid){
    $get_member_count = DB::fetch_first('SELECT * FROM %t WHERE uid= %d', array('common_member_count', "$uid"), 'uid');
	return $get_member_count;
}

function get_member_profile($uid){
    $get_member_profile = DB::fetch_first('SELECT * FROM %t WHERE uid= %d', array('common_member_profile', "$uid"), 'uid');
	return $get_member_profile;
}

function get_thread_aid($tid){
	$attachment = DB::fetch_first('SELECT * FROM %t WHERE tid=%d ORDER BY tid DESC', array('forum_attachment', "$tid"));
	$table='forum_attachment_'.substr($attachment['tableid'], -1);
	$thread_aid = DB::fetch_first('SELECT * FROM %t WHERE tid=%d ORDER BY tid DESC', array("$table", "$tid"));
	return $thread_aid;
}

function get_thread_aid_array($tid,$order){
	$thread_aid_array = array();
	$table='forum_attachment_'.substr($tid, -1);
	$thread_aid_array = DB::fetch_all("SELECT aid,tid FROM ".DB::table($table)." WHERE tid='$tid' AND isimage!=0 ORDER BY $order ASC");
	$thread_aid_array['pics'] = count($thread_aid_array);
	return $thread_aid_array;

}

function arrayToString($arr) { 
	if (is_array($arr)){ 
		return implode(',', array_map('arrayToString', $arr)); 
	} 
	return $arr; 
}

function get_thread_pic($catfid,$num){
	$forum_gid = $catfid; 
	$forum_forum = DB::fetch_all("select fid from ".DB::table('forum_forum')." where fup = $forum_gid");
	$gid_fid = arrayToString($forum_forum);
	$thread_pic = DB::fetch_all("select * from ".DB::table('forum_thread')." where fid in($gid_fid) And attachment!=0 order by dateline desc limit 0,$num ");
	return $thread_pic;
}

function get_thread_list($catfid,$order,$num){
	$forum_gid = $catfid; 
	$forum_forum = DB::fetch_all("select fid from ".DB::table('forum_forum')." where fup = $forum_gid");
	$gid_fid = arrayToString($forum_forum);
	$thread_list = DB::fetch_all("select * from ".DB::table('forum_thread')." where fid in($gid_fid) order by $order desc limit 0,$num");
	return $thread_list;
}

function get_tag_array($order,$num){
	$tag_array = DB::fetch_all("select * from ".DB::table('common_tag')." order by $order desc limit 0,$num");
	return $tag_array;
}

function get_home_follow($uid,$num){

	$home_follow = DB::fetch_all("select * from ".DB::table('home_follow')." where uid = $uid order by followuid desc limit 0,$num ");

	return $home_follow;

}

function get_thread_tag_array($tid){
	$post = DB::fetch_first("SELECT tags FROM ".DB::table(forum_post)." WHERE first=1 AND tid='$tid' ");
	$tagarray_all = $posttag_array = array();
	$tagarray_all = explode("\t", $post['tags']);
	if($tagarray_all) {
		foreach($tagarray_all as $var) {
			if($var) {
				$tag = explode(',', $var);
				$posttag_array[] = $tag;
				$tagnames[] = $tag[1];
			}
		}
	}
	$post['tags'] = $posttag_array;
	return $post['tags'];
}

function get_thread_message($tid,$num){
	require_once(DISCUZ_ROOT."./source/function/function_post.php");
	$thread_message = messagecutstr(DB::result_first('SELECT message FROM '.DB::table('forum_post').' WHERE tid ='.$tid.' AND first =1'),$num);
	return $thread_message;

}

function get_uid_thread($uid,$order,$num){
	$array = array();
	$rs = DB::query("SELECT tid,subject,dateline FROM ".DB::table("forum_thread")." WHERE authorid='$uid' AND displayorder>=0 AND attachment=2 order by $order desc limit $num");
	while ($rw = DB::fetch($rs)){
		$table ='forum_attachment_'.substr($rw['tid'], -1);
		$rw['aid'] = DB::result_first("SELECT aid FROM ".DB::table("$table")." WHERE tid ='{$rw['tid']}' AND isimage =1 order by aid ASC");
		$array[] = $rw;
	}
	return $array;
}


function get_forum_forumfield($fid){
    $get_forum_forumfield = DB::fetch_first('SELECT * FROM %t WHERE fid= %d', array('forum_forumfield', "$fid"), 'fid');
	return $get_forum_forumfield;
}

function get_uid_home_comment($uid,$num){
    $get_uid_home_comment = DB::fetch_all("select * from ".DB::table('home_comment')." where uid = $uid AND idtype = 'uid' order by cid desc limit 0,$num ");
	return $get_uid_home_comment;
}

function get_uid_forum($uid){
	$count = C::t('forum_moderator')->count_by_uid($uid);
	if($count) {
		foreach(C::t('forum_moderator')->fetch_all_by_uid($uid) as $result) {
			$moderatefids[] = $result['fid'];
		}
		$query = C::t('forum_forum')->fetch_all_info_by_fids($moderatefids);
		foreach($query as $result) {
			$manage_forum[$result['fid']] = $result['name'];
		}
	}
	return $manage_forum;
}
<!--{/eval}-->

<meta name="application-name" content="$_G['setting']['bbname']" />
	<meta name="msapplication-tooltip" content="$_G['setting']['bbname']" />
	<!--{if $_G['setting']['portalstatus']}--><meta name="msapplication-task" content="name=$_G['setting']['navs'][1]['navname'];action-uri={echo !empty($_G['setting']['domain']['app']['portal']) ? 'http://'.$_G['setting']['domain']['app']['portal'] : $_G[siteurl].'portal.php'};icon-uri={$_G[siteurl]}{IMGDIR}/portal.ico" /><!--{/if}-->
	<meta name="msapplication-task" content="name=$_G['setting']['navs'][2]['navname'];action-uri={echo !empty($_G['setting']['domain']['app']['forum']) ? 'http://'.$_G['setting']['domain']['app']['forum'] : $_G[siteurl].'forum.php'};icon-uri={$_G[siteurl]}{IMGDIR}/bbs.ico" />
	<!--{if $_G['setting']['groupstatus']}--><meta name="msapplication-task" content="name=$_G['setting']['navs'][3]['navname'];action-uri={echo !empty($_G['setting']['domain']['app']['group']) ? 'http://'.$_G['setting']['domain']['app']['group'] : $_G[siteurl].'group.php'};icon-uri={$_G[siteurl]}{IMGDIR}/group.ico" /><!--{/if}-->
	<!--{if helper_access::check_module('feed')}--><meta name="msapplication-task" content="name=$_G['setting']['navs'][4]['navname'];action-uri={echo !empty($_G['setting']['domain']['app']['home']) ? 'http://'.$_G['setting']['domain']['app']['home'] : $_G[siteurl].'home.php'};icon-uri={$_G[siteurl]}{IMGDIR}/home.ico" /><!--{/if}-->
	<!--{if $_G['basescript'] == 'forum' && $_G['setting']['archiver']}-->
		<link rel="archives" title="$_G['setting']['bbname']" href="{$_G[siteurl]}archiver/" />
	<!--{/if}-->
	<!--{if !empty($rsshead)}-->$rsshead<!--{/if}-->

	<script type="text/javascript" src="{$_G[setting][jspath]}home.js?{VERHASH}"></script>
	<link rel="stylesheet" type="text/css" href='{$_G['setting']['csspath']}{STYLEID}_css_space.css?{VERHASH}' />
<link rel="stylesheet" type="text/css" href='{$_G['setting']['csspath']}{STYLEID}_home_space.css?{VERHASH}' />
	<link id="style_css" rel="stylesheet" type="text/css" href="{STATICURL}space/{if $space[theme]}$space[theme]{else}t1{/if}/style.css?{VERHASH}">
 <!--{if $_G['basescript'] == 'home' }-->
	<style type="text/css">
	 #ct{background-image:url(template/huyou_zisy/klp_img/home/defaultbannar.jpg) !important;background-size:cover !important}
	</style>
<!--{/if}-->
	<style id="diy_style">$space[spacecss]</style>
	<link rel="stylesheet" href="template/huyou_zisy/klp_img/home/style.css">
  
	<!--{if $_G['basescript'] === 'home' && $_GET[ac]=='upload' || $_G['basescript'] === 'home' && $_GET[ac]=='blog'}-->
	<link rel="stylesheet" href="template/huyou_zisy/klp_img/home/upload.css">
	<!--{/if}-->
	<script type="text/javascript">window.onerror=function(){return true;} </script>
</head>

<body id="nv_{$_G[basescript]}" class="pg_{CURMODULE}{if $_G['basescript'] === 'portal' && CURMODULE === 'list' && !empty($cat)} {$cat['bodycss']}{/if}" onkeydown="if(event.keyCode==27) return false;">
	<div id="append_parent"></div><div id="ajaxwaitid"></div>
	<!--{if $_GET['diy'] == 'yes' && check_diy_perm($topic)}-->
		<!--{template common/header_diy}-->
	<!--{/if}-->
	<!--{if check_diy_perm($topic)}-->
		<!--{template common/header_diynav}-->
	<!--{/if}-->
	<!--{if CURMODULE == 'topic' && $topic && empty($topic['useheader']) && check_diy_perm($topic)}-->
		$diynav
	<!--{/if}-->
	<div id="toptb" class="v cl">
		<!--{if $_G['uid']}-->
			<div class="y">

				<a href="home.php?mod=space&uid=$_G[uid]" class="xw1 klp_homesuername" title="{lang visit_my_space}">{$_G[member][username]}</a>
				<a href="javascript:;" id="myspace" class="showmenu cur1 klp_homemynav" onmouseover="showMenu(this.id);">{lang my_nav}</a>
				<span class="klp_homehook1"><!--{hook/global_usernav_extra1}--></span>
				<a href="home.php?mod=spacecp" class="klp_homesetup">{lang setup}</a>
				<a href="home.php?mod=space&do=pm" id="pm_ntc" class="klp_homepm {if $_G[member][newpm]} new{/if}">{lang pm_center}<!--{if $_G[member][newpm]}-->($_G[member][newpm])<!--{/if}--></a>
				<a href="home.php?mod=space&do=notice" id="myprompt" class="klp_homenotice {if $_G[member][newprompt]}new{/if}">{lang remind}<!--{if $_G[member][newprompt]}-->($_G[member][newprompt])<!--{/if}--></a><span id="myprompt_check"></span>
				<!--{if $_G['group']['allowmanagearticle'] || $_G['group']['allowdiy']|| getstatus($_G['member']['allowadmincp'], 4) || getstatus($_G['member']['allowadmincp'], 2) || getstatus($_G['member']['allowadmincp'], 3) || in_array($_G['uid'], $_G['setting']['ext_portalmanager'])}--><a href="portal.php?mod=portalcp" class="klp_homepcp">{lang portal_manage}</a><!--{/if}-->
				<!--{if $_G['uid'] && $_G['group']['radminid'] > 1}--><a href="forum.php?mod=modcp&fid=$_G[fid]" class="klp_homefcp">{lang forum_manager}</a><!--{/if}-->
				<!--{if $_G['uid'] && ($_G['group']['radminid'] == 1 || getstatus($_G['member']['allowadmincp'], 1))}--><a href="admin.php" class="klp_adcp">{lang admincp}</a><!--{/if}-->
				<!--{hook/global_usernav_extra2}-->
				<a href="member.php?mod=logging&action=logout&formhash={FORMHASH}">{lang logout}</a>
			</div>
		<!--{elseif !empty($_G['cookie']['loginuser'])}-->
			<div class="y">
				<a id="loginuser" class="xw1">$_G['cookie']['loginuser']</a>
				<a href="member.php?mod=logging&action=login" onclick="showWindow('login', this.href)">{lang activation}</a>
				<a href="member.php?mod=logging&action=logout&formhash={FORMHASH}">{lang logout}</a>
			</div>
		<!--{elseif $_G['connectguest']}-->
			<div class="y">
				{lang connect_fill_profile_to_view}
			</div>
		<!--{else}-->
			<div class="y">
				<a href="member.php?mod={$_G[setting][regname]}">$_G['setting']['reglinkname']</a>
				<a href="member.php?mod=logging&action=login" onclick="showWindow('login', this.href)">{lang login}</a>
			</div>
		<!--{/if}-->
		<div class="z">
			<a href="./" title="$_G['setting']['bbname']" class="xw1">首页</a>
			<a href="home.php?mod=space&do=home" id="navs" class="showmenu" onmouseover="showMenu(this.id);">空间首页</a>
		</div>
	</div>
	<!--{if $space['status'] == -1 && $_G['adminid'] == 1 }-->
		<p class="ptw xw1 xi1 hm"><img src="{IMGDIR}/locked.gif" alt="Locked" class="vm" /> {lang message_banned}</p>
	<!--{/if}-->


	<!--{if !empty($_G['setting']['plugins']['jsmenu'])}-->
		<ul class="p_pop h_pop" id="plugin_menu" style="display: none">
		<!--{loop $_G['setting']['plugins']['jsmenu'] $module}-->
		     <!--{if !$module['adminid'] || ($module['adminid'] && $_G['adminid'] > 0 && $module['adminid'] >= $_G['adminid'])}-->
		     <li>$module[url]</li>
		     <!--{/if}-->
		<!--{/loop}-->
		</ul>
	<!--{/if}-->
	$_G[setting][menunavs]

	<!--{eval $mnid = getcurrentnav();}-->
	<ul id="navs_menu" class="p_pop topnav_pop" style="display:none;">
		<!--k**l**p-->
	<!--{loop $_G['setting']['navs'] $nav}-->
		<!--{eval $nav_showmenu = strpos($nav['nav'], 'onmouseover="showMenu(');}-->
		<!--{eval $nav_navshow = strpos($nav['nav'], 'onmouseover="navShow(')}-->
		<!--{if $nav_hidden !== false || $nav_navshow !== false}-->
		<!--{eval $nav['nav'] = preg_replace("/onmouseover\=\"(.*?)\"/i", '',$nav['nav'])}-->
		<!--{/if}-->
		<!--{if $nav['available'] && (!$nav['level'] || ($nav['level'] == 1 && $_G['uid']) || ($nav['level'] == 2 && $_G['adminid'] > 0) || ($nav['level'] == 3 && $_G['adminid'] == 1))}--><li {$nav[nav]}></li><!--{/if}-->
	<!--{/loop}-->
	</ul>
	<ul id="myspace_menu" class="p_pop" style="display:none;">
		<li><a href="home.php?mod=space">{lang my_space}</a></li>
		<!--{loop $_G['setting']['mynavs'] $nav}-->
			<!--{if $nav['available'] && (!$nav['level'] || ($nav['level'] == 1 && $_G['uid']) || ($nav['level'] == 2 && $_G['adminid'] > 0) || ($nav['level'] == 3 && $_G['adminid'] == 1))}-->
				<li>$nav[code]</li>
			<!--{/if}-->
		<!--{/loop}-->
	</ul>


	<div id="body">

<script src="http://connect.qq.com/widget/loader/loader.js" widget="shareqq" charset="utf-8"></script>
	<div id="wp" class="klp_mnwp">

